package com.umer.pinban.datafenxi.adapter;

import android.content.Context;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.common.ui.recycleview.adapter.RecyclerviewBasicAdapter;
import com.common.ui.recycleview.base.ViewHolder;
import com.common.ui.recycleview.listener.OptListener;
import com.umer.pinban.R;
import com.umer.pinban.bean.fenxi.ProjectExpenseListBean;
import java.util.List;

public class DataFenXiAdapterEight extends RecyclerviewBasicAdapter<ProjectExpenseListBean> {

    private OptListener optListener;

    public DataFenXiAdapterEight(Context context, List<ProjectExpenseListBean> datas, int layoutId,
                                 OptListener optListener) {
        super(context, datas, layoutId);
        this.optListener = optListener;
    }

    @Override
    public void convert(ViewHolder holder, final ProjectExpenseListBean projectExpenseListBean, final int position) {

        LinearLayout linear_eight = holder.getView(R.id.linear_eight);
        TextView tv_six_name = holder.getView(R.id.tv_six_name);
        TextView tv_number = holder.getView(R.id.tv_number);
        TextView tv_number2 = holder.getView(R.id.tv_number2);

        tv_six_name.setText(projectExpenseListBean.getCommodityName());
        tv_number.setText(""+projectExpenseListBean.getExpenseNum());
        tv_number2.setText("" + projectExpenseListBean.getSurplusNum());


        linear_eight.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                optListener.onOptClick(v,position);
            }
        });
    }
}
